package com.lunevich.demo.activities;

import com.lunevich.demo.ImageAdapter;
import com.lunevich.demo.ImageLoaderDemoActivity;
import com.lunevich.demo.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ListView;

public class ListViewActivity extends Activity implements OnClickListener {
	
	private ImageAdapter imageAdapter;
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
		setContentView(R.layout.listview);

		ListView list = (ListView) findViewById(R.id.listView);
		imageAdapter = new ImageAdapter(this);
		list.setAdapter(imageAdapter);
		
		Button btnBack = (Button)findViewById(R.id.btnBack);
		
		btnBack.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.btnBack:
			Intent backIntent = new Intent(ListViewActivity.this, ImageLoaderDemoActivity.class);
			startActivity(backIntent);
			break;

		default:
			break;
		}
	}
}
